package com.tenbent.product.base.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.tenbent.product.base.bo.BizObject;

import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;

/**
 *
 * DTO 基类 Created by ThinkPad on 2017/8/4.
 */
// @JsonIgnoreProperties({ "delFlag", "createId", "modifyId", "createDate",
// "modifyDate" })
public class BaseDto implements Serializable {

	/** ID属性 **/
	private Integer id;

	/** 删除标识 **/
	@JsonIgnore
	private Integer delFlag;

	/** 创建人ID **/
	@JsonIgnore
	private Integer createId;

	/** 修改人ID **/
	@JsonIgnore
	private Integer modifyId;

	/** 创建日期 **/
	@JsonIgnore
	private Date createDate;

	/** 修改日期 **/
	@JsonIgnore
	private Date modifyDate;

	public BaseDto() {

	}

	public BaseDto(BizObject obj) {
		setId(obj.getId());
		setDelFlag(obj.getDelFlag());
		setCreateId(obj.getCreateId());
		setModifyId(obj.getModifyId());
		setCreateDate(obj.getCreateDate());
		setModifyDate(obj.getModifyDate());
	}

	public void transToBo(BizObject obj) {
		obj.setId(this.getId());
		obj.setDelFlag(this.getDelFlag());
		obj.setCreateId(this.getCreateId());
		obj.setModifyId(this.getModifyId());
		obj.setCreateDate(this.getCreateDate());
		obj.setModifyDate(this.getModifyDate());
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(Integer delFlag) {
		this.delFlag = delFlag;
	}

	public Integer getCreateId() {
		return createId;
	}

	public void setCreateId(Integer createId) {
		this.createId = createId;
	}

	public Integer getModifyId() {
		return modifyId;
	}

	public void setModifyId(Integer modifyId) {
		this.modifyId = modifyId;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getModifyDate() {
		return modifyDate;
	}

	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}
}
